> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/jaypopat/cf_ai_duet/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> SSH-first pair programming with shared terminal and AI assistance

## What is Duet?

Duet is an SSH-first pair programming tool that lets you collaborate in real-time through a shared live terminal. Built with Go and Charm (Bubbletea/Wish), Duet combines the simplicity of SSH with powerful features like AI assistance and sandboxed command execution.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Connect and start your first pairing session in under a minute
  </Card>

  <Card title="AI assistant" icon="robot" href="/features/ai-assistant">
    Get help from an AI agent powered by Cloudflare Workers
  </Card>

  <Card title="Shared terminal" icon="terminal" href="/features/shared-terminal">
    Real-time collaborative terminal with nvim and nodejs
  </Card>

  <Card title="Sandbox execution" icon="cube" href="/features/sandbox-execution">
    Run commands safely in an isolated Cloudflare sandbox
  </Card>
</CardGroup>

## Key features

### Shared terminal

All participants in a session share the same live terminal environment. Every keystroke, command, and output is synchronized in real-time across all connected users.

```bash theme={null}
# Everyone sees the same terminal state
$ git clone https://github.com/user/repo
$ cd repo
$ npm install
```

The terminal comes pre-configured with:

* **nvim** - For collaborative code editing
* **nodejs** - For running JavaScript/TypeScript projects
* Full shell environment for seamless development

### AI features

Duet includes an AI assistant powered by Cloudflare's LLM (Llama) with persistent context per room using Durable Objects.

<Note>
  Press `ctrl+g` in any session to ask the AI a question. The AI has access to your entire conversation history within the room.
</Note>

The AI can help with:

* Code explanations and debugging
* Architecture suggestions
* Command recommendations
* Learning and teaching programming concepts

### Sandbox features

Run commands in an isolated Cloudflare sandbox without affecting the main terminal environment.

```bash theme={null}
# Press ctrl+r to open sandbox command prompt
Command to run: npm test
```

Perfect for:

* Testing potentially destructive commands
* Running isolated builds
* File operations without side effects
* Safe experimentation

<Warning>
  Sandbox features require a Cloudflare Workers paid plan and only work in local development mode.
</Warning>

## Use cases

<CardGroup cols={3}>
  <Card title="Teaching" icon="graduation-cap">
    Walk students through code in real-time with shared context
  </Card>

  <Card title="Interviews" icon="user-tie">
    Conduct technical interviews with live coding sessions
  </Card>

  <Card title="Pair programming" icon="users">
    Collaborate on code with teammates remotely
  </Card>
</CardGroup>

## How it works

Duet uses a simple client-server architecture:

1. **SSH connection** - Users connect via standard SSH client
2. **Room-based sessions** - Create or join rooms with unique IDs
3. **Terminal synchronization** - All input/output is broadcast to room participants
4. **AI integration** - Optional AI assistance via Cloudflare Workers

```mermaid theme={null}
graph LR
    A[User 1] -->|SSH| C[Duet Server]
    B[User 2] -->|SSH| C
    C -->|AI Requests| D[Cloudflare Worker]
    D -->|LLM| E[Llama Model]
    D -->|Context| F[Durable Objects]
    D -->|Sandbox| G[Cloudflare Sandboxes]
```

## Architecture

Duet is built with modern Go and leverages the Charm ecosystem:

* **Server**: Go with [Wish](https://github.com/charmbracelet/wish) SSH server
* **UI**: [Bubbletea](https://github.com/charmbracelet/bubbletea) TUI framework
* **Styling**: [Lipgloss](https://github.com/charmbracelet/lipgloss) for terminal styling
* **AI/Sandbox**: Cloudflare Workers with Durable Objects and Sandboxes

## Ready to get started?

<Card title="Quickstart guide" icon="play" href="/quickstart">
  Connect to Duet and create your first pairing session
</Card>
